<style>
{literal}
.file_browse_input{
	position:relative;text-align: left;-moz-opacity:0 ;filter:alpha(opacity: 0);opacity: 0;z-index: 2;
	*position:inherit;*-moz-opacity:100 ;*filter:alpha(opacity: 100);*opacity:100;
}
.file_browse_fake{
	position:absolute;*position:inherit;top: 0px;left: 0px;z-index:1;*display:none;
}
{/literal}
</style>

<div style="background:#FFFFFF;display:none; position:absolute; border:2px solid #999;width:625px" id="upload_new">
                  <div class="header" style="padding:5px; font-size:14px"><strong>Upload ảnh mới</strong><img src="style/images/i_close2.gif" width="13" height="13" class="boxClose" style="cursor:pointer; padding:2px; margin-left:500px; position:absolute" /></div>
                  <div style="height: expression( this.scrollHeight > 420 ? '420px' : 'auto' );overflow:auto; max-height:400px;">
                    <div id="add_more">
                    </div>
                    <div id="origin_form">
                  {foreach from=$post_item_images item=image}
                    <form class="upload_form" id="upload_form{$image.index}" name="upload_form{$image.index}"  lang="{$image.index}" enctype="multipart/form-data" method="post" action="">
                    
                    <table cellpadding="1" border="0" style="width:600px;">	
                        <tr>
                          <td width="4" align="center" valign="top">[{$image.index}]</td>
                          <td width="30" align="center" valign="top">
                            <img src="{$image.image_url}" style="border:1px solid #CCC" alt="" name="thumb_{$image.index}" width="60" height="60" id="thumb_{$image.index}"  title=""/> 
                            <center style="color:#ccc;font-size:8px" id="real_name_{$image.index}">
                            {$image.real_name}
                          </center><div style="color:#FF0000;cursor:pointer;display:none;width:60px" id="cancel{$image.index}"><b>Hủy bỏ</b></div>	</td>
                          <td  align="left">
                                <div id="board{$image.index}">
                                <table cellpadding="2" border="0" style="width:100%">
                                    <tr>
                                        <td align="left" valign="top">
                        <strong>Chọn file ảnh <font style="color:#000; font-weight:bold;">(<font color="red">File: jpg, jpeg, gif, png <strong>&lt; 2MB</strong></font>)</font>:</strong>
                        <div style="position: relative;*position:inherit">
                                <input type="file" size="45" class="file_browse_input browse_file" lang="{$image.index}" name="img_upload[{$image.index}]" id="img_upload{$image.index}"/>
                                <div class="file_browse_fake">
                                  <input class="fake_input" readonly="readonly"  value="Chọn ảnh từ Máy tính"   id="fake_input{$image.index}" style="border:1px solid #CCCCCC;float:left;margin-top:2px;width:220px; background-color:#fff" /><img style="float:left;margin:0px;" src="style/images/button_chon_anh.gif" />        
                              </div>
                        </div>	</td>
                              <td width="244" align="left" valign="top">
                        <strong>Hoặc URL:</strong><br /> 
                        <input type="text" value="{$image.url}" name="url[{$image.index}]" class="url_input" lang="{$image.index}" id="url{$image.index}" style="width:99%"/></td>
                            </tr>
                            <tr>
                              <td align="left" valign="top">
                              <strong>Mô tả cho ảnh: </strong><br />
                                  <input type="text" value="{$image.des}" name="des[{$image.index}]" id="des{$image.index}"   style="width:99%" maxlength="50"/></td>
                              <td align="left" valign="top"><input type="submit" value="Tải lên" id="submit{$image.index}" style="cursor:pointer;width:49%;margin-top:12px;float:left;display:none"/>
                                <!--<input type="button" style="cursor:pointer;width:49%;margin-top:12px" value="Tải thêm ảnh" id="add_more{$image.index}" onclick="add_upload();"/> --> <img id="loading{$image.index}" src="style/images/uploading.gif" style="margin-top:12px;float:left;margin-left:10px;display:none" />
                                <input type="hidden" value="" name="src[{$image.index}]" id="src{$image.index}" />
                                </td>
                                    </tr>
                                </table>
                                </div>      </td>
                        </tr>    
                    </table>
                   
                    </form>
                     
                    {/foreach}
                    </div>
                 </div>
</div>

<div style="background:#FFFFFF;display:none;position:absolute; border:2px solid #999;width:625px" id="upload_update">
    <div class="header" style="padding:5px; font-size:14px"><strong>Cập nhật thông tin cho ảnh</strong><img src="style/images/i_close2.gif" width="13" height="13" class="boxUpdateClose" style="cursor:pointer; padding:2px; margin-left:430px; position:absolute" /></div>
  <div style="height: expression( this.scrollHeight > 420 ? '420px' : 'auto' );overflow:auto; max-height:400px;">
   <form id="upload_update_form" name="upload_update_form" lang="" enctype="multipart/form-data" method="post" action="">
    <table cellpadding="1" border="0" style="width:600px;">	
        <tr>
        	<td width="30" align="center" valign="top">
            <img src="" style="border:1px solid #CCC" alt="" name="thumb_update" width="60" height="60" id="thumb_update"  title=""/> 
            <center style="color:#ccc;font-size:8px" id="real_name_update"></center>
            <img id="loading_update" src="style/images/uploading.gif" style="width:60px;display:none" />
            	</td>
          <td  align="left">
               <table cellpadding="2" border="0" style="width:100%">
                    <tr>
                        <td align="left" valign="top">
        <strong>Chọn ảnh mới <font style="color:#000; font-weight:bold;">(<font color="red">File: jpg, jpeg, gif, png <strong>&lt; 2MB</strong></font>)</font>:</strong>
        <div style="position: relative;*position:inherit">
                <input type="file" size="45" class="file_browse_input" name="img_upload_update" id="img_upload_update"/>
                <div class="file_browse_fake">
                  <input readonly="readonly"  value="Chọn ảnh từ Máy tính"   id="fake_input_update" style="border:1px solid #CCCCCC;float:left;margin-top:2px;width:220px; background-color:#fff" /><img style="float:left;margin:0px;" src="style/images/button_chon_anh.gif" />        
              </div>
        </div>	</td>
              <td width="244" align="left" valign="top">
        <strong>Hoặc URL:</strong><br /> 
        <input type="text" value="" name="url_update" id="url_update" style="width:99%"/></td>
            </tr>
            <tr>
              <td align="left" valign="top">
              <strong>Mô tả cho ảnh: </strong><br />
                  <input type="text" value="" name="des_update" id="des_update"   style="width:99%" maxlength="50"/></td>
              <td align="left" valign="top"><input type="submit" value="Cập  nhật" style="cursor:pointer;width:49%;margin-top:12px;float:left"/> <input type="button" style="cursor:pointer;width:49%;margin-top:12px;margin-left:2px;float:left" id="cancel_update" value='Nhập lại'/>
                
                </td>
                    </tr>
                </table>
          </td>
        </tr>    
    </table>
    </form>
 </div>
</div>
<div class="gallery_top" style="margin-top:5px">
	<div class="gallery_top_left">
    	<div class="gallery_top_right">
			<div align="left">
                <div class="gallery_title" align="left"><a href="gallery.html{if $gallery_user_id}?user_id={$gallery_user_id}{/if}">Thư viện ảnh cá nhân của &quot;{$user_name}&quot;</a></div>
                <div id="buttonUpload" class="btn_upload_gallery" align="center">UP ẢNH MỚI</div>
                <div style="clear:right"><span></span></div>
            </div>
            <div align="left" style="padding-left:18px; _margin-top:-15px;">
            {$begin_form}
                  <div class="floatLeft" style="margin-top:-1px;*margin-top:0">
                     Tìm ảnh: 
                    
                    <input name="keywords" class="gallery_input" id="keywords" value="{$keywords}"/>
                     </div>
                  <div class="floatLeft" style="*margin-top:3px; margin-left:5px; margin-right:5px;"> 
                    <select name="year" id="year" >
                    {$option_year}
                    </select> 
                    <select name="month" id="month">
                    {$option_month}
                    </select>                    
                    <select name="day" id="day">
                    {$option_day}
                    </select> 
                  </div>
                  <div style="margin-top:2px;">
                    <input type="submit" id="btn_search_gallery" class="btn_search_gallery" value="Tìm ảnh" title="Tìm ảnh" style="cursor:pointer"/>  
                   </div> 
                   
                   <div style="clear:left"><span></span></div>
                   {if $gallery_user_id}
                   <input type="hidden" name="user_id" id="user_id"  value="{$gallery_user_id}" />
                   {/if}
                  {$end_form}     
           </div>
        </div>
    </div>
</div>  

<div style="width:970px; clear:both">
{if $paging}
<div class="bg_pagging_gallery">
	<div class="left_pagging_gallery">
    	<div class="right_pagging_gallery">
        	<div align="left">
            	
            	<div class="pagging_gallery" style="margin-left:15px;"><strong>Có tổng số {$total} ảnh | &nbsp;</strong>{$paging}</div>
               
            	
            </div>	
         </div>
    </div>
</div>
{/if}
<div id="personal_gallery">
    <div id="new_img_uploaded"></div>
    {if $items}
    {foreach from=$items item=items}
      <div  class="list_gallery_images" align="center" id="list_gallery_images{$items.id}">	
        <div class="top_gallery_images">	
            <div style="width:122px; height:122px;vertical-align:middle;border:1px solid #CCC" align="center">
                     <a class="img_thumb" id="href_{$items.id}"  href="{$items.im_link}" lang="{$items.direct_link}" style="display:block">
                     <img  id="preview_image{$items.id}" title="Xem ảnh trên web" alt="{$items.des}" src="{$items.img_url}" width="120" height="120" style="border:1px solid #f000"/>
                    </a>
            </div>	
            <div align="left" style="padding:5px;height:24px;overflow:hidden;color:#999" title="{$items.des}" id="des{$items.id}">{$items.des}</div>
        </div>
        <div class="bg_bottom_gallery_images">
            <div class="bottom_gallery_images"> 
                <div>
                    <a onclick="del_images({$items.id});" href="javascript:void(0);">
                Xóa</a> | <a href="javascript:void(0);" onclick="show_update({$items.id});">Sửa</a>  | <a href="{$items.direct_link}" target="_blank">Ảnh gốc</a> <br />
                    (<font color="green">
                    {$items.time}</font>)
                </div>	
                <div class="info_add" lang="{$items.id}"><a>Mã nhúng</a></div>
            </div>
        </div>
        
        
        <div align="left" class="more_info_img" id="info_add{$items.id}">
            DirectLink: <span class="copy copied_direct" id="copied_direct{$items.id}">(Đã copy)</span>
        <input value="{$items.direct_link}" id="link_direct{$items.id}" class="link_direct img_info" onclick="highlight(getElementById('link_direct{$items.id}'))" title="Click để Copy" readonly="readonly" type="text" lang="{$items.id}"/>
        HTML code: <span class="copy copied_html" id="copied_html{$items.id}">(Đã copy)</span>
        <input value="{$items.html_code}" id="link_html{$items.id}" class="img_info link_html" onclick="highlight(getElementById('link_html{$items.id}'))" title="Click để Copy" readonly="readonly" type="text" lang="{$items.id}"/>
        BB code: <span class="copy copied_bb" id="copied_bb{$items.id}">(Đã copy)</span>
        <input value="{$items.bb_code}" id="link_bb{$items.id}" class="img_info link_bb" onclick="highlight(getElementById('link_bb{$items.id}'))" title="Click để Copy" readonly="readonly" type="text" lang="{$items.id}"//>
        Email &amp; IM: <span class="copy copied_im"  id="copied_im{$items.id}">(Đã copy)</span>
        <input value="{$items.im_link}" id="link_im{$items.id}"  class="img_info link_im" onclick="highlight(getElementById('link_im{$items.id}'))" title="Click để Copy" readonly="readonly"  type="text" lang="{$items.id}"/>
        </div>
      </div>
    {/foreach}
    {else}
        <div style="padding:10px" id="div_no_images" align="center">
            <strong>Chưa có ảnh nào cả! Bạn hãy thử tìm lại với điều kiện khác ( từ khoá, ngày, tháng...) hoặc Upload ảnh mới vào thư viện ảnh cá nhân của bạn!</strong>
        </div>
    {/if}
</div>
<div style="clear:left"><span></span></div>
{if $paging}
<div class="bg_pagging_gallery">
	<div class="left_pagging_gallery">
    	<div class="right_pagging_gallery">
        	<div align="center">
            	<div class="pagging_gallery" style="margin-left:15px;"><strong>Có tổng số {$total} ảnh | &nbsp;</strong>{$paging}</div>
            	
            </div>	
         </div>
    </div>
</div>
{/if}
</div>
<div style="width:970px;margin:4px 0;padding-top:4px ;clear:both" align="center">
<input type="button" value="Load lại thư viện ảnh" onclick="{literal}window.location=url_y+'&year='+getValueId('year');{/literal}" style="width:120px;cursor:pointer" title="Load lại thư viện ảnh"/></div>
<script language="javascript">
var url_y="{$url_y}";
var url_m="{$url_m}";
var url_d="{$url_d}";

//For Upload:
var more_id		={$more_id};
var no_img		='{$no_image_url}';
var image_path	='{$image_path}';
var user_id		='{$user_id}';
var index_current='1';
var max_upload	={$max_upload};
{literal}
jQuery(document).ready(function(){
	jQuery("#year").change(function() {
		window.location=url_y+"&year="+getValueId('year');
	});
	jQuery("#month").change(function() {
		window.location=url_m+"&month="+getValueId('month');
	});
	jQuery("#month").change(function() {
		window.location=url_m+"&month="+getValueId('month');
	});
	jQuery("#day").change(function() {
		window.location=url_d+"&day="+getValueId('day');
	});
	jQuery(".img_info").livequery('click',function (){
		this.select();
	});
	jQuery(".info_add").livequery('click',function (){
		var display=jQuery("#info_add"+this.lang).css("display");
		jQuery(".more_info_img").css("display","none");
		if(display=='none')jQuery("#info_add"+this.lang).toggle();
	});
	check_all_perform();
});
{/literal}
</script>